package com.csw.xuxianParent.xuxianSms.listener;

import java.util.Map;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import com.csw.xuxianParent.xuxianSms.util.MessageSend;

@Component
@RabbitListener(queues = "xuxian")
public class SmsListener {
	@Value("${aliyun.sms.signName}")
	private String signName;
	@Value("${aliyun.sms.templateCode}")
	private String templateCode;
	@Value("${aliyun.sms.accessKeyId}")
	private String accessKeyId;
	@Value("${aliyun.sms.accessSecret}")
	private String accessSecret;

	@RabbitHandler
	public void sendCode(Map<String, String> map) {
		MessageSend.send(map.get("mobile"), map.get("code"), signName, templateCode, accessKeyId, accessSecret);
	}
}
